package ai.zixing.example01;

import java.io.Serializable;

public class ConcretePrototype2 implements Cloneable, Serializable {

    private Person person;

    public Person getPerson() {
        return person;
    }

    public void setPerson(Person person) {
        this.person = person;
    }

    public void show() {
        System.out.println("当前用户姓名: " + person.getName());
    }

    public ConcretePrototype2() {
        System.out.println("具体圆形对象创建成功");
    }

    @Override
    protected ConcretePrototype2 clone() throws CloneNotSupportedException {
        System.out.println("克隆对象复制成功");
        return (ConcretePrototype2) super.clone();
    }
}
